

#import "FirtstViewController.h"

#import "RootViewController.h"
@interface FirtstViewController ()

@end

@implementation FirtstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIScrollView * scroolView= [[UIScrollView alloc]init];
    [self.view addSubview:scroolView];
    scroolView.bounces=NO;
    scroolView.showsHorizontalScrollIndicator=NO;
    scroolView.pagingEnabled=YES;
    scroolView.userInteractionEnabled=YES;
    [scroolView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view.mas_top).offset(0);
        make.bottom.equalTo(self.view.mas_bottom).offset(0);
        make.left.equalTo(self.view.mas_left).offset(0);
        make.right.equalTo(self.view.mas_right).offset(0);
    }];
    UIImageView * imageView1 =[[UIImageView alloc]init];
    [scroolView addSubview:imageView1];
    UIImageView * imageView2 =[[UIImageView alloc]init];
    [scroolView addSubview:imageView2];
    UIImageView * imageView3 =[[UIImageView alloc]init];
    [scroolView addSubview:imageView3];
    [imageView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(scroolView.mas_top).offset(0);
        make.bottom.equalTo(scroolView.mas_bottom).offset(0);
        make.left.equalTo(scroolView.mas_left).offset(0);
        make.right.equalTo(imageView2.mas_left).offset(0);
        make.height.equalTo(@[scroolView,imageView2,imageView3]);
        make.width.equalTo(@[scroolView,imageView2,imageView3]);
    }];
    [imageView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(scroolView.mas_top).offset(0);
        make.right.equalTo(imageView3.mas_left).offset(0);
    }];
    [imageView3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(scroolView.mas_top).offset(0);
        make.right.equalTo(scroolView.mas_right).offset(0);
    }];
    imageView1.image=[UIImage imageNamed:@"first.jpg"];
    imageView2.image=[UIImage imageNamed:@"first2.jpg"];
    imageView3.image=[UIImage imageNamed:@"first1.jpg"];
    imageView1.backgroundColor=[UIColor redColor];
    imageView2.backgroundColor=[UIColor yellowColor];
    imageView3.backgroundColor=[UIColor greenColor];
    imageView3.userInteractionEnabled=YES;
    UITapGestureRecognizer * tap =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickGoto:)];
    [imageView3 addGestureRecognizer:tap];
}
-(void)clickGoto:(id)sender
{
    RootViewController * root=[[RootViewController alloc]init];
    [self presentViewController:root animated:YES completion:nil];

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
